import React, { Component } from 'react';
import { connect } from 'dva';
import './index.scss';

import Desc from './components/desc/index';

@connect(({ detail, loading }) => ({
  ...detail,
  ...loading
}))
export default class Detail extends Component {

  componentDidMount() {
    this.props.dispatch({
      type: 'detail/getGoodsDescData',
      payload: {
        goodsNo: 'P2118120000094639'
      }
    });

    console.log(this.props)
  }

  render() {
    const { productDesc, effects } = this.props

    return (
      <div className='detail'>
        <p>this is Detail</p>
        {!effects['detail/getGoodsDescData'] && 
          <Desc productDesc={productDesc} />
        }
      </div>
    )
  }
}

